import { useClockHook } from '@/hooks';
import React, { useState, useEffect } from 'react';
import './index.less';
import weatherIcon from './assets/image/weatherIcon.png';

export default function (props) {
  const { date, time, week } = useClockHook();
  const [subtitle, setSubtitle] = useState(0);
  return (
    <div className="top2-header">
      <div
        className={
          subtitle == 0 ? 'subtitle subtitle-leftL' : 'subtitle subtitle-left'
        }
        onClick={() => {
          setSubtitle(0);
        }}
      >
        数据平台
      </div>
      <div className="header-title">数字化智慧杀虫监测管理</div>
      {/* <div className="header-title">病媒设备管理云平台</div> */}
      <div
        className={
          subtitle == 0 ? 'subtitle subtitle_right' : 'subtitle subtitle_rightL'
        }
        onClick={() => {
          setSubtitle(1);
        }}
      >
        iot平台
      </div>
      <div className="time1">
        <span>{time}</span>
        {/* <span className="date">{date} </span> */}
        {/* <span className="week">{week} </span> */}
      </div>
      <div className="weather1">
        {/* <span style={{ marginRight: 10 }}>多云</span> */}
        <span className="date">当前城市：上海市</span> &nbsp;&nbsp;
        <img src={weatherIcon} width={15} />
      </div>

      <div className="header-light" />
    </div>
  );
}
